import { getLayoutProps } from "@/common/layout/getProps";
import GlobalClasses from "@/styles/globalClasses.module.scss";
import { PageContainer } from "@ant-design/pro-layout";
import { Table, type TableColumnsType } from "antd";

const VotingRet = () => {
  const data: Record<string, any>[] = Array(5).fill(0).map((t, i) => {
    return {
      field1: "系统创新部",
      field2: `王月${i + 1}`,
      field3: 10,
      field4: 10,
      field5: 10,
      field6: 10,
      field7: 10,
      field8: 10,
      field9: 10,
      field10: 10,
      field11: 80,
      field12: 10,
      field13: 10,
      field14: 60,
      field15: 100,
    }
  })

  const columns: TableColumnsType = [
    {
      align: "center",
      title: "序号",
      width: 60,
      key: "index",
      render: (_text, _record, index) => {
        return index + 1
      }
    },
    {
      align: "center",
      title: "部门",
      dataIndex: "field1"
    },
    {
      align: "center",
      title: "姓名",
      dataIndex: "field2"
    },
    {
      align: "center",
      title: "评委得分",
      dataIndex: "field1",
      children: Array(8).fill(0).map((t, i) => {
        return {
          align: "center",
          title: "xxx",
          dataIndex: `field${i + 3}`
        }
      })
    },
    {
      align: "center",
      title: "总分",
      dataIndex: "field11"
    },
    {
      align: "center",
      title: "去掉最高",
      dataIndex: "field12"
    },
    {
      align: "center",
      title: "去掉最低",
      dataIndex: "field13"
    },
    {
      align: "center",
      title: "得分",
      dataIndex: "field14"
    },
    {
      align: "center",
      title: "备注(扣除最值总分)",
      dataIndex: "field15"
    }
  ]

  return (
    <PageContainer header={{title: ""}}>
      <div
        className={[GlobalClasses.title, "title", 'flex', 'justify-between'].join(" ")}>
        2024年第一季度优秀员工评分计算表
      </div>

      <Table
        columns={columns}
        dataSource={data}
      ></Table>
    </PageContainer>
  )
};

export const getServerSideProps = getLayoutProps;
export default VotingRet;
